﻿CREATE PROCEDURE [dbo].[books_select_by_author]
    @authorId int = 0
AS
SELECT
    Books.BookId,
    Books.Title AS Book_Title,
    Books.DateOfPublish AS Books_DateOfPublish,
    Books.ShortContent AS Books_ShortContent,
    Books.Avatar AS Books_Avatar

FROM [dbo].[Books] 
    inner join BooksByAuthor ON Books.BookId = BooksByAuthor.BookId
WHERE BooksByAuthor.AuthorId = @authorId

RETURN 0
